#!/usr/bin/env python
# -*- coding:utf-8 -*-

from __future__ import unicode_literals

from django.db import models

# Create your models here.

class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    ctime = models.DateTimeField(auto_now=True) #自动把当前时间填入

    def __unicode__(self):
        return self.name

class SimpleModel(models.Model):
    username = models.CharField(max_length=64)
    password = models.CharField(max_length=64)

class UserGroup(models.Model):
    caption = models.CharField(max_length=64)
    def __unicode__(self):
        return self.name

class User(models.Model):
    username = models.CharField(max_length=64)
    user_group = models.ForeignKey(UserGroup)
    def __unicode__(self):
        return self.name